package com.example.demo.config;

import com.example.demo.intercept.ProjectIntercept;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ProjectConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册拦截器
        registry.addInterceptor(new ProjectIntercept())
                // 设置拦截路径，这里设置为所有路径
                .addPathPatterns("/**");
    }
}
